﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Oroboros;
using Oroboros.Objects;
using Oroboros.Save_Data;

namespace Save_Editor.Controls
{
    /// <summary>
    /// Interaction logic for GeneratorSaveData.xaml
    /// </summary>
    public partial class ctrlGeneratorSaveData : UserControl
    {
        public ctrlGeneratorSaveData()
        {
            InitializeComponent();
        }

        public GeneratorSaveData Generator
        {
            get { return (GeneratorSaveData)this.DataContext; }
            set { this.DataContext = value; }
        }
    }

    public class NullBoolToBool : IValueConverter
    {

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value.GetType() == typeof(bool))
            {
                return new bool?((bool)value);
            }
            else
            {
                return null;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value.GetType() == typeof(bool))
            {
                return (bool)value;
            }
            else
            {
                return null;
            }
        }
    }
}
